#ifndef RESERVEDTABLE_H_
#define RESERVEDTABLE_H_

#include "Defines.h"

/*-----------------------------------------------------------------------------
 *  Palavras reservadas
 *-----------------------------------------------------------------------------*/
#define WD_PROGRAM     "program"
#define WD_BEGIN       "begin"
#define WD_END         "end"
#define WD_CONST       "const"
#define WD_VAR         "var"
#define WD_REAL        "real"
#define WD_INTEGER     "integer"
#define WD_PROCEDURE   "procedure"
#define WD_ELSE        "else"
#define WD_READLN      "readln"
#define WD_WRITELN     "writeln"
#define WD_REPEAT      "repeat"
#define WD_UNTIL       "until"
#define WD_IF          "if"
#define WD_THEN        "then"
#define WD_WHILE       "while"
#define WD_DO          "do"

namespace LALG
{

/*
 * =====================================================================================
 *        Class:  ReservedTable
 *  Description:  Classe que representa a tabela de palavras reservados
 * =====================================================================================
 */
class ReservedTable
{

public:

    /*-----------------------------------------------------------------------------
     *  Constrói a tabela de palavras reservadas com os valores iniciais
     *-----------------------------------------------------------------------------*/
    ReservedTable();

    /*-----------------------------------------------------------------------------
     *  Verifica se o ID passado é uma palavra reservada
     *-----------------------------------------------------------------------------*/
    TokenType operator [](const string& word);

private:

    /*-----------------------------------------------------------------------------
     *  Estrutura para armazenar as palavras reservadas (operações são O(1))
     *-----------------------------------------------------------------------------*/
    unordered_map<string, TokenType> table;

};

}

#endif /* SYMBOLSTABLE_H_ */
